#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"

void app_main()
{
    setup_ledc();

    while (1)
    {
        for (int i = 0; i < sizeof(melody) / sizeof(int); i++)
        {
            int duration_ms = 1000 / durations[i]; // 计算节拍时间
            play_tone(melody[i], duration_ms);
        }
        vTaskDelay(pdMS_TO_TICKS(2000)); // 循环间隔
    }
}